Skip to content

feat(VaultManager): Implement contract to manage StakeVaults for improving UX and conforming to standard ERC-4626#146

Open
3esmit wants to merge 29 commits intodevelopfrom
vault-manager
Open

feat(VaultManager): Implement contract to manage StakeVaults for improving UX and conforming to standard ERC-4626#146
3esmit wants to merge 29 commits intodevelopfrom
vault-manager

Conversation

@3esmit
Copy link
Copy Markdown
Collaborator

@3esmit 3esmit commented Oct 7, 2024

Description

Describe the changes made in your pull request here.

Checklist

Ensure you completed all of the steps below before submitting your pull request:

  • Added natspec comments?
  • Ran pnpm adorno?
  • Ran pnpm verify?

3esmit and others added 29 commits July 2, 2024 09:37
…och when account starts staking in middle of epoch
…stake amount, fix doubling totalSupply of epochs, add view to calculate MPs for externally any amount for any delta time
This commit updates the balanceOf function in the StakeManager contract. It now includes the calculation for the maximum MP that can be minted based on the account's balance and the time since the last mint. This ensures accurate balance calculation for the account.
…and remove restake ability

- Update imports to use the correct ERC20 interface
- Modify the `mint` and `deposit` functions to include an optional lock period
- Add a new `mint` function with a lock period parameter
- Add a new `deposit` function with a lock period parameter
- Modify the `redeem` and `withdraw` functions to include an authorization mechanism
- Modify the `redeem` and `withdraw` functions to use the `onlyVaultOwnerAuthorized` modifier
- Add a new `leave` function to allow the owner to leave all vaults
- Add a new `acceptMigration` function to accept migration for all vaults
- Update the `asset` function to use the `stakedToken` function from the stakeManager
- Update the `totalAssets` function to use the `totalSupplyBalance` function from the stakeManager
- Add new functions for previewing max deposit, max mint, max withdraw, and max redeem amounts
- Update the `_convertToShares` function to use the `totalSupply` and `totalSupplyBalance` functions from the stakeManager
- Update the `_convertToAssets` function to use the `totalSupplyBalance` and `totalSupply` functions from the stakeManager
- Remove the `transfer` and `allowance` functions as they are not needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants